package com.cskaoyan.controller;

import com.cskaoyan.bean.TopicDetailVO;
import com.cskaoyan.bean.WxRelated;
import com.cskaoyan.bean.WxTopicList;
import com.cskaoyan.bean.basebean.BasePageData;
import com.cskaoyan.bean.basebean.BaseRespVo;
import com.cskaoyan.service.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



/**
 * @description: ${description}
 * @author: cuicui
 **/
@RestController
@RequestMapping("wx/topic")
public class WXTopic {

    @Autowired
    TopicService topicService;

    @GetMapping("list")
    public BaseRespVo topicList(Integer page,Integer limit){
        BasePageData<WxTopicList> wxTopicList = topicService.listTopic(page,limit);
        return BaseRespVo.ok(wxTopicList,"成功");
    }

    @GetMapping("detail")
    public BaseRespVo topicDetail(Integer id){
        TopicDetailVO vo = topicService.detail(id);
        return BaseRespVo.ok(vo,"成功");
    }

    @GetMapping("related")
    public BaseRespVo topicRelated(Integer id){
        BasePageData<WxRelated> basePageData = topicService.related(id);
        return BaseRespVo.ok(basePageData,"成功");
    }


}
